# -*- coding: utf-8 -*-  
import os
import os.path

pathh = "/home/cwh8szh/mmdetection_psd_20220107/slot_ocr/slot_ocr_rotate/new/"

for filenames in os.walk(pathh):
    filenames = list(filenames)
    filenames = filenames[2]
    for filename in filenames:
        print(filename)
        with open ("ocr.txt",'a') as f:
            f.write(pathh+filename+'\n')
